package com.ftu.srv.demo.controller;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ftu.srv.demo.entity.Person;
import com.ftu.srv.demo.service.AbstractProcessHandler;

@Controller
public class App {
    private static Logger logger = LoggerFactory.getLogger(App.class);
    
    @Autowired
    private Map<String, AbstractProcessHandler> processHandlerMap;
    @Autowired
    private List<AbstractProcessHandler> processHandlerList;
    
    @ResponseBody
    @RequestMapping(value = "app")
    public Person test() {
        for(AbstractProcessHandler handler : processHandlerList) {
            handler.handler("hand");
        }
        
        logger.info("hello");
        System.out.println("hello");
        return new Person().setName("test").setAge(10);
    }

}
